email me at borlaj@portlandschools.org

Loading
notes previous (10/<10) submit the dump links  
 

HWJ14_Timing

Create an applet that when started, a ball will appear in the center and then move at a random direction (by random I mean anywhere within a span of -10 to 10 pixels on the x and y) If it hits a wall, it will bounce off it realistically. If the person hits r, the ball will reset in the middle w/ a new direction.

Start with the timing code found here. You will need to add the keylistener stuff. (implement runnable, KeyListener

(remember to have nec. imports and init statement).

 

Extension:

  1. Have the ball slowly slow down.